<include file="Public:head" />
<style>
    tr td{
        text-align: center;
    }
    .dannum{
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        text-align: left;
    }
</style>
<body class="overflow-hidden">
<div class="wrapper preload">
    <include file="Public:header" />
    <include file="Public:left" />

    <div class="main-container">
        <div class="padding-md">
            <div class="row">
                <div class="col-sm-12">
                    <div class="page-title">
                        机构管理
                    </div>
                </div>
            </div>
            <div class="col-sm-12 row chach">
                 <button class="action-button" type="button" onclick="window.open('{:U("Unit/add")}','_self')">新增机构</button>
            </div>
            <div class="row">
                <div class="col-lg-12">
                    <div class="smart-widget widget-green">
                        <div class="smart-widget-header row ">
                            <span class="smart-widget-option">
                                <span class="refresh-icon-animated">
                                    <i class="fa fa-spinner fa-spin" style="color:#fff"></i>
                                </span>
                                <a href="#" class="widget-toggle-hidden-option">
                                </a>
                                <a href="#" class="widget-collapse-option" data-toggle="collapse">
                                </a>
                                <a href="#" class="widget-refresh-option">
                                </a>
                            </span>
                        </div>
                        <div class="smart-widget-inner table-responsive">
                            <div class="smart-widget-hidden-section">
                                <ul class="widget-color-list clearfix">
                                    <li style="background-color:#20232b;" data-color="widget-dark"></li>
                                    <li style="background-color:#4c5f70;" data-color="widget-dark-blue"></li>
                                    <li style="background-color:#23b7e5;" data-color="widget-blue"></li>
                                    <li style="background-color:#1fb5ac;" data-color="widget-green"></li>
                                    <li style="background-color:#edbc6c;" data-color="widget-yellow"></li>
                                    <li style="background-color:#fbc852;" data-color="widget-orange"></li>
                                    <li style="background-color:#e36159;" data-color="widget-red"></li>
                                    <li style="background-color:#7266ba;" data-color="widget-purple"></li>
                                    <li style="background-color:#f5f5f5;" data-color="widget-light-grey"></li>
                                    <li style="background-color:#fff;" data-color="reset"></li>
                                </ul>
                            </div>
                            <table class="table table-striped no-margin">
                                <thead>
                                <tr>
                                    <th class="text-center" style="width:10%">序号</th>
                                    <th class="text-center" style="width: 20%">地区</th>
                                    <th class="text-center">机构名称</th>
                                    <th class="text-center" style="width: 0%">操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                <notempty name="_list">
                                    <volist name="_list" id="vo" empty="对不起暂时没有数据" key="k">
                                        <tr>
                                            <td><?php echo ((($_GET['p']?$_GET['p']:1)-1)*10+$k)?></td>
                                            <td>{$vo.city|jiangSu}</td>
                                            <td>{$vo.name}</td>
                                            <td>
                                                <if condition="$vo['status'] eq 0">
                                                    <a href="{:U('doAuditUnit',array('id'=>$vo['id']))}" class="ajax-get confirm">审核</a>
                                                    <!--<button  class="ajax-get btn btn-primary" href="{:U('doAuditUnit',array('id'=>$vo['id']))}">审核</button>-->
                                                </if>
                                                <a href="{:U('info',array('id'=>$vo['id']))}">查看</a>
                                                <a href="{:U('edit',array('id'=>$vo['id']))}">修改</a>
                                                <a href="#" onclick="show_ip({$vo['id']},this)" data_name="{$vo.name}" data_id="{$vo['id']}" data_ip="{$vo['ip']}"> IP地址配置</a>
                                            </td>
                                        </tr>
                                    </volist>
                                    <else/>
                                    <tr><td colspan="4"></td></tr>
                                </notempty>
                                </tbody>
                            </table>
                            <div class="choose-page row">
                                {$_page}
                            </div>
                        </div><!-- ./smart-widget-inner -->
                    </div><!-- ./smart-widget -->
                </div><!-- ./col -->
            </div><!-- ./row -->
        </div><!-- ./padding-md -->
    </div><!-- /main-container -->
    <include file="Public:foot" />
</div><!-- /wrapper -->
<include file="Public/base_fc" />
<a href="#" class="scroll-to-top hidden-print"><i class="fa fa-chevron-up fa-lg"></i></a>
</body>
</html>
<block name="script">
    <script>
        $(function(){
            highlight_nav2('{:U("Unit/index")}');
        })
        function show_ip(id,obj){
            $('#myModal_admin1').modal('show');
            var data_name = $(obj).attr('data_name');
            var data_id = $(obj).attr('data_id');
            var data_ip = $(obj).attr('data_ip');
            $('.show_name').text(data_name);
            $('#show_id').val(data_id);
            $('textarea[name="ip"]').val(data_ip);
        }
    </script>
</block>
<div class="modal fade" id="myModal_admin1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"  style="margin-top: 80px">
    <div class="modal-dialog chery_dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myModalLabel">IP地址匹配</h4>
            </div>

            <div class="modal-body">
                <div class="right-panel-main">
                    <form class="form-horizontal form_admin7" action="{:U('Unit/ipConfig')}" method="post">
                        <div class="form-group" style="margin-left: 10px;">
                            <label class="control-label">机构：<span class="show_name"></span></label>
                            <input type="hidden" name="id" value="" id="show_id"/>
                        </div>
                        <div class="form-group" style="margin-left: 10px;">
                            <label class="control-label">IP地址：</label>
                            <textarea name="ip" class="form-control" rows="3" style="width: 90%;">{$info.ip}</textarea>
                        </div>
                        <div class="form-group" style="margin-left: 10px;">
                            <button type="submit" target-form="form_admin7" class="action-button ajax-post">保存</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
